package JFrame;

import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.EventQueue;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JSplitPane;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;

public class JSplit extends JFrame {

	private JPanel contentPane;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					JSplit frame = new JSplit();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public JSplit() {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 450, 300);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		contentPane.setLayout(new BorderLayout(0, 0));
		setContentPane(contentPane);
		
		JPanel panel=new JPanel(new FlowLayout(FlowLayout.CENTER,2,3));
		
		panel.add(new JButton("bun1"));
		panel.add(new JButton("bun2"));
		panel.add(new JButton("bun3"));
		panel.add(new JButton("bun4"));
		panel.add(new JButton("bun5"));
		
		JPanel panel1=new JPanel(new GridLayout(3,3,3,3));
		for(int i=0;i<9;i++){
			JButton jb=new JButton("button"+i);
			panel1.add(jb);
		}
		
		JSplitPane lfsplit=new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,panel,panel1);
		
		lfsplit.setDividerSize(5);
		lfsplit.setDividerLocation(100);
		
		contentPane.add(lfsplit);
		setContentPane(contentPane);
	}

}
